-export LINUX_RELEASE ?=2.6
+export LINUX_SERIES ?=2.6
+
+# Root path to install in.
+# Set to '/' to install relative to filesystem root.
+export prefix?=$(shell cd ../../dist/install && pwd)
+
+.PHONY: all compile
+.PHONY: gc-install gc-clean gc-prstine
+.PHONY: vnetd vnet-module install dist clean pristine
all: compile
tar xfz gc.tar.gz
ln -sf gc?.? gc
-gc-install: gc
- (cd gc && ./configure --prefix=`pwd`/install && make && make install)
+gc/Makefile:
+ (cd gc && ./configure --prefix=`pwd`/install)
+
+gc-install: gc gc/Makefile
+ make -C gc
+ make -C gc install
gc-clean:
-$(MAKE) -C gc clean
gc-pristine:
-rm -rf gc?.? gc
-.PHONY: vnetd vnet-module install dist clean
-
vnetd: gc-install
$(MAKE) -C vnetd
$(MAKE) -C examples install
dist: $(TARGET)
- $(MAKE) prefix=`pwd`/../../install dist=yes install
+ $(MAKE) install
clean:
-$(MAKE) -C vnetd clean
-$(MAKE) -C vnet-module clean
+
+pristine: clean gc-pristine
The makefiles use the following variables, which
can be set in your env or on the make command line:
-LINUX_RELEASE: linux release to compile for, 2.4 (default), or 2.6.
-XENO_ROOT: root of the xen tree containing kernel source. Default '..'.
-ROOT: root path to install in, default is XENO_ROOT/install.
- Set to '/' to install relative to filesystem root.
-KERNEL_VERSION: kernel version, default got from XENO_ROOT.
+LINUX_SERIES: linux release to compile for, 2.4 (default), or 2.6.
+XEN_ROOT: root of the xen tree containing kernel source.
+KERNEL_VERSION: kernel version, default got from XEN_ROOT.
KERNEL_MINOR: kernel minor version, default -xen0.
-KERNEL_SRC: path to kernel source, default linux-<VERSION> under XENO_ROOT.
+KERNEL_SRC: path to kernel source, default linux-<VERSION> under XEN_ROOT.
*) For 2.4 kernel
To compile from scratch:
make clean
-make
+make LINUX_SERIES=2.4
This will build vnet_module.o in the current directory.
To install the module use
-make install
+make LINUX_SERIES=2.4 install
*) For 2.6 kernel
To compile from scratch:
make clean
-make LINUX_RELEASE=2.6
+make
This will build vnet_module.ko in the current directory.
To install the module use
-make LINUX_RELEASE=2.6 install
+make install
#============================================================================
ifeq ($(src),)
-LINUX_RELEASE ?=2.6
+LINUX_SERIES ?=2.6
-include Makefile-$(LINUX_RELEASE)
+include Makefile-$(LINUX_SERIES)
#============================================================================
else
#============================================================================
# Vnet module makefile for 2.4 series kernels.
+LINUX_SERIES ?=2.4
include Makefile.ver
KERNEL_MODULE := vnet_module.o
#============================================================================
# Vnet module makefile for 2.6 series kernels.
-LINUX_RELEASE ?= 2.6
+LINUX_SERIES ?=2.6
include Makefile.ver
KERNEL_MODULE = vnet_module.ko
prefix ?=$(XEN_ROOT)/install/
#----------------------------------------------------------------------------
-LINUX_RELEASE ?=2.6
+LINUX_SERIES ?=2.6
KERNEL_MINOR ?=-xen0
-LINUX_VERSION ?= $(shell ( /bin/ls -ld $(XEN_ROOT)/linux-$(LINUX_RELEASE).*-xen-sparse ) 2>/dev/null | \
+LINUX_VERSION ?= $(shell ( /bin/ls -ld $(XEN_ROOT)/linux-$(LINUX_SERIES).*-xen-sparse ) 2>/dev/null | \
sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
ifeq ($(LINUX_VERSION),)
-$(error Kernel source for linux $(LINUX_RELEASE) not found)
+$(error Kernel source for linux $(LINUX_SERIES) not found)
endif
KERNEL_VERSION =$(LINUX_VERSION)$(KERNEL_MINOR)